import countries from 'i18n-iso-countries'
import zhLocale from 'i18n-iso-countries/langs/zh.json' // en.json

countries.registerLocale(zhLocale)
const countrys = countries.getNames('zh')

const getCountry = code => {
  return countries.getName(code, 'zh')
}

const getCountrys = codes => {
  return codes.map(item => getCountry(item))
}

export default {
  countrys,
  getCountry,
  getCountrys
}
